#ifndef _LCDTEXT_H
#define _LCDTEXT_H

#define FONT_WIDTH 6 

#define LINE_WIDTH (WIDTH/FONT_WIDTH)
#define ASCII_OFFSET 0x20
#define ASCII_MAX 0xEF

// initialize lcd. Must be called before any use of other lcd_* functions
void lcd_init(void);
// write an alphanumeric symbol to position pos. Position 0 is upper left corner of the display
unsigned char lcd_writechar(unsigned char pos, unsigned char character);
// write a text buf of length len containing only alphanumeric symbols to position pos. Position 0 is upper left corner of the display
unsigned char LCDWriteText(unsigned char pos, unsigned char len, byte* buf);
// scroll 1 line down
void lcd_scrolldown(void);
// read status of controller con
unsigned char lcd_status(unsigned char con);
// set parameters of both controllers
inline void lcd_onoff(unsigned char onoff);
inline void lcd_adc(unsigned char inv);
inline void lcd_stdrive(unsigned char onoff);
inline void lcd_duty(unsigned char duty);
inline void lcd_setstring(unsigned char n);
inline void lcd_setpage(unsigned char page);
// clear lcd 
void lcd_clear(unsigned char color);
// set column on controller side to col
void lcd_setcol(unsigned char side, unsigned char col);
// write byte of data to controller side
void lcd_writebyte(unsigned char side, unsigned char b);
// read byte of data from controller side
unsigned char lcd_readbyte(unsigned char side);

#endif